(These programs may be freely copied provided that this file is attached and they are not sold for profit. They are used entirely at your own risk).
Mersenne numbers are of the form 2^n-1 and are named after a 17th century French theologian who included mathematics in his many interests. Over many years the largest known current prime number has usually been a Mersenne number. This is not because they are particularly fruitful as a source of primes but because it is easier to check their primality than that of most other numbers. One necessary but not sufficient requirement is that the powern is itself a prime.
The programs in this directory avoid the use of strings so they are not necessarily limited to integers of less than 256 digits - a restriction that must be avoided when dealing with many Mersenne numbers.
MersenneA
If your printer is switched on this program will print out all the Mersenne numbers with prime powers of 2 up to 89 and the next three Mersenne primes. These have powers 107, 127 and 521. If you only want a print out to the screen you MUST delete the line containing VDU 2.
Mersenne1
In this program the arrays are such that only n up to 847 is possible, ie. numbers with up to 256 digits.
Mersenne2
Here the arrays are extended so that you can calculate 2^4253-1, the first known prime with more than 1000 digits. (It has 1281 of them).
Mersenne3
The arrays are extended again to calculate 2^8191-1 which was at one time, incorrectly, thought to be prime. (2466 digits).
Mersenne4
With this you can get 2^8472-1 which has no special interest except that if you wait long enough it will need to use all 32 lines of your screen at 80 digits per line to print out.
Note: When calculating a Mersenne number with the programs Mersenne 1 to 4 choose the one with the lowest limit for n (the power of 2) that is yet greater than the n of the number you want. The smaller the number of arrays the faster the calculation.
LucasTest
The Lucas-Lehmer test is the reason Mersenne numbers are prime favourites. Inthis program it checks the primality of all the Mersenne numbers calculated in MersenneA, except for n=521, and shows the time needed for this check.
LucasTest5
Here you can test any Mersenne number up to 2^847-1. After n=127 the next Mersenne prime has n=521. The check takes just over 8 minutes with ARM3 fitted.
The next prime has n=607.
LucasTest7
In case you think your computer is being somewhat dilatory in making this check you may like to see a printout of the intermediate steps in the calculation. Use this program and check with n=127 and then, if you have time, with n=521.